// custom-tab-bar/index.js
Component({

  /**
   * 组件的属性列表
   */
  properties: {

  },

  lifetimes: {
    ready: function(){
    },
  },

  /**
   * 组件的初始数据
   */
  data: {
    tabbarList: [{
      "selectedIconPath": "../assets/tabBar/home_select.png",
      "iconPath": "../assets/tabBar/home.png",
      "pagePath": "/pages/Tabbar/Home/Home",
      "text": "首页"
    }, {
      "selectedIconPath": "../assets/tabBar/personals_select.png",
      "iconPath": "../assets/tabBar/personals.png",
      "pagePath": "/pages/Tabbar/Personals/Personals",
      "text": "交友"
    }, {
      "selectedIconPath": "../assets/tabBar/member_select.png",
      "iconPath": "../assets/tabBar/member.png",
      "pagePath": "/pages/Tabbar/Member/Member",
      "text": "会员"
    }, {
      "selectedIconPath": "../assets/tabBar/user_select.png",
      "iconPath": "../assets/tabBar/user.png",
      "pagePath": "/pages/Tabbar/User/User",
      "text": "我的"
    }],
    active: 0,
  },

  /**
   * 组件的方法列表
   */
  methods: {
    onChange(event) {
      // console.log(event,'event')
      let _this = this;
      if(_this.data.active != event.detail){
        wx.switchTab({
          url: _this.data.tabbarList[event.detail].pagePath,
        });
        // console.log(_this.data.tabbarList[event.detail],'active')
      }
    },
  }
})